package com.java.admin.controller;

import com.java.admin.service.UserService;
import com.java.param.CartListParam;
import com.java.param.PageParam;
import com.java.pojo.User;
import com.java.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public R list(PageParam pageParam){
        return userService.list(pageParam);
    }

    @PostMapping("/remove")
    public R remove(CartListParam cartListParam){
        return userService.remove(cartListParam);
    }
    @PostMapping("/update")
    public R update(User user){
        return userService.update(user);
    }
    @PostMapping("/save")
    public R save(User user){
        return userService.save(user);
    }


}
